Convergence parameters

class convergence_parameters.TNConvergenceParameters(max_iter=20, abs_deviation=4e-12, rel_deviation=1e-12, n_points_conv_check=4, max_bond_dimension=5, trunc_method='R', cut_ratio=1e-09, increase_precision=False, measure_obs_every_n_iter=1, svd_ctrl='V', random_sweep=False, skip_exact_rgtensors=False, svd_threshold=1e-15, min_expansion=20, expansion_cycles=1, expansion_drop='f', arnoldi_initial_tolerance=0.01, arnoldi_min_tolerance=0.0, arnoldi_max_tolerance=0.01, arnoldi_maxiter=32, krylov_maxiter=32, krylov_tol=1e-07, aggression_tolerance=1.0, aggression_expansion=1.0, statics_method=2, imag_evo_dt=0.1, filename_conv='ConvergenceInput.dat', trunc_tracking_mode='C', data_type='A', ini_bond_dimension=None, min_bond_dimension=1, device='cpu')[source]

Handling of the convergence parameters for the tensor network simulations.

Arguments

max_iterinteger, optional

Maximum number of sweeps in the ground state search. Default to 20.

abs_deviationfloat, optional

Exit criterion for ground state search if the energy of the current sweep has an absolute per-sweep deviation from the previous data points below this threshold: \(max(|E - E_{last}|) / n_points_conv_check < abs_deviation\) Default to 4e-12.

rel_deviationfloat, optional

Exit criterion for ground state search if the energy of the current sweep has a relative per-sweep deviation from the previous data points below this threshold. \(max(|E - E_{last}|) / n_points_conv_check < rel_deviation * |E_{last}|\) Default to 1e-12.

n_points_conv_checkint, optional

Number of data points used when checking convergence, e.g., for the ground state search. Exit criteria are not checked until this many sweeps have been performed, and are never checked if n_points_conv_check > max_iter. Default to 4. It must be >= 2.

max_bond_dimensionint, optional

The maximal bond dimension used during the simulations. The default value is purely a starting point for testing simulations. Default to 5.

trunc_methodstr, optional

Python only Method use to truncate the singular values. Default to “R”. Available: - “R”: use cut_ratio - “N”: use maximum norm

cut_ratiofloat, optional (python side only)

Python only If trunc_method=”r”:

Cut ratio \(\epsilon\) after which the singular values are neglected, i.e. if \(\lambda_1\) is the bigger singular values then after an SVD we neglect all the singular values such that \(\lambda_i/\lambda_1\leq\epsilon\).

If trunc_method=”n”:

Maximum value of the norm neglected for the singular values during the trunctation.

Default to 1e-9.

increase_precision

TBA

measure_obs_every_n_iterint

Modulo for measuring statics every n iterations. Not propagated through yet on the fortran side.

svd_ctrlcharacter, optional

Control for the SVD algorithm. Available: - “A” : automatic. Some heuristic is run to choose the best mode for the algorithm.

The heuristic can be seen in tensors/tensors.py in the function _process_svd_ctrl.

  • “V” : gesvd. Safe but slow method. Recommended in Fortran simulation

  • “D” : gesdd. Fast iterative method. It might fail. Resort to gesvd if it fails

  • “E”eigenvalue decomposition method. Faster on GPU. Available only when

    contracting the singular value to left or right

  • “X”sparse eigenvalue decomposition method. Used when you reach the maximum

    bond dimension. Only python.

  • “R”random SVD method. Used when you reach the maximum bond dimension.

    Only python.

Default to ‘V’.

random_sweepbool, optional

Use random sweep scheme instead of default scheme. Default to False.

skip_exact_rgtensorslogical, optional

Allows to skip space expansion if the tensors has already reached the maximal bond dimension of the underlying local Hilbert spaces, i.e., full Hilbert space is captured without truncation of entanglement. It does not introduce errors itself as the tensor represents a unitary transformation with a complete orthogonal set of vector; the idea originates in the renormalization group (RG) where combining two sites is a unitary transformation as long as the new link dimension is as big as the underlying Hilbert space of all local Hilbert spaces combined. As it mostly skips operators on tensors much below the bond dimension, the benefit lies in avoiding to move the isometry (see TTN and moving through higher layers), communication overhead for sending small tensors, and in the future jit-compilation for many different bond dimensions. [py-only: filter before the sweep applied; avoids even isometrizing towards the skipped tensors.] [f90-only: Only applies to sweep with space expansion.] Default to False.

svd_thresholdfloat

TBA (only first accessed if array on fortran side)

min_expansionint, optional

Amount by which the bond dimension is increased at every expansion cycle when doing link expansion. In Python it is also used when doing an expanding QR, in which case the value is the percentage increase. Default to 20.

expansion_cyclesint

For space link expansion, the link between a tensor and its predefined partner tensor are expanded. Then, each tensor and partner tensors are optimized expansion_cycles times. Default to 1.

expansion_dropcharacter out of [“f”, “o”, “d”]

Behavior what to do if space link expansion leads to worse energy than before with options expansion_drop=”f” for false (accept worse energies to escape local minima), “o” for optimize single tensor (reinstall original tensors, but optimize as in a single tensor update), and “d” for discarding step (reinstall original tensors and skip optimization). Not passed through to Fortran backend. Default to “f”.

arnoldi_initial_tolerance

Fortran: TBA python: unused so far

arnoldi_min_tolerance

Fortran: TBA python: unused so far

arnoldi_max_tolerance

TBA (Fortran only)

arnoldi_maxiterint

Python only : right now, evaluated in qtealeaves-eigensolver (not Arpack) Maximum number of Lanczos vectors to be used.

krylov_maxiterint

Python only : right now, evaluated in KrylovSolver, time evolution only. Default to 32.

krylov_tolfloat

Python only : right now, evaluated in KrylovSolver, time evolution only. Default to 1e-7.

aggression_tolerance

TBA

aggression_expansion

TBA

statics_methodinteger, optional

Method to run ground state search for this/all iteration. 0 : default (2) 1 : sweep 2 : sweep with space expansion (can still be reduced to sweep

during the simulation based on a energy condition)

3 : imaginary time evolution with two-tensor TDVP (Fortran only) 4 : imaginary time evolution with TDVP space expansion (python-only) 5 : imaginary time evolution with TDVP single-site (python-only) 33 : imaginary nearest-neighbor TEBD.

imag_evo_dtfloat, optional

Time-step size for the imaginary time evolution. Default to 0.1.

filename_convstr, optional

The convergence parameters are saved under this filename inside the input folder. Default to ConvergenceInput.dat.

trunc_tracking_modestr, optional

Python only: Modus for storing truncation, ‘M’ for maximum, ‘C’ for cumulated of the singvals squared (Norm truncated) (default).

data_typestr, optional

Data type of the TN. “A” : automatic (“Z”) “Z” : double precision complex “C” : single precision complex “D” : double precision real “S” : single precision real

ini_bond_dimensionint, optional

Python only. The initial bond dimension used during the simulations when the initialization is random. Using subspace expansion or two-site updates the bond dimension can grow. Default to max_bond_dimension.

devicestr, optional

Device where to run the optimization. “cpu” : run on cpu with numpy “gpu” : run on gpu with cupy

min_bond_dimensionint, optional

[python-only] Set the minimum bond dimension. One value independent of the sweeps. Default to 1.

property data_type

Provide the getter method for this property important to the MPS emulator. It allows to get values without a dictionary, but prevents doing it if the values is not an integer. (Not queried from the MPS for now).

get_chi(params)[source]

Shortcut to evaluate the bond dimension as numeric parameter.

Arguments

paramsdict

The parameter dictionary for the simulation.

property max_bond_dimension

Provide the getter method for this property important to the MPS emulator. It allows to get values without a dictionary, but prevents doing it if the values is not an integer.

property min_expansion_qr

Provide the getter method for this property important to the python emulator. It is the percentage of the bond dimension increase in the qr

prepare_parameters_for_iteration(params)[source]

Preparation to write parameters for each iteration. It checks if a list of convergence settings has to be written and builds a dictionary with the resolved entries for each parameters, which is either a the value or a list of values.

Arguments

paramsdict

Dictionary with the simulation parameters.

Results

has_vector_of_settingsbool

True if settings change over the iterations and the parameters have to be written for each iteration.

sim_param_alldict

Contains the resolved convergence parameters, i.e., strings and functions are resolved with the actual values.

resolve_params(params, idx=None)[source]

Resolve parameterized values (inplace-update).

resolve_params_copy(params, idx=None)[source]

Return a copy of the convergence parameters with all parameterized values resolved.

write_input(folder_name, params)[source]

Write convergence parameters for input version 2 and 3.

Arguments

folder_namestr

Name of the input folder, where the file with the convergence parameters is written to.

paramsdict

Dictionary with the simulation parameters.

class convergence_parameters.TNConvergenceParametersFiniteT(t_grid, dt_max=0.1, measure_obs_every_n_iter=20, k_b=1, **kwargs)[source]

Convergence parameters for finite temperature. Based on the input temperature grid, the time grid for imaginary time evolution is created. The largest value of time step is limited with the input dt_max.

Parameters

t_gridlist or np.ndarray

Temperature grid, we want to take measurements for each point in the grid. The temperature grid must be sorted in descending order.

dt_maxfloat, optional

Maximal time step for imaginary time evolution. Default is 0.1.

measure_obs_every_n_iterint, optional

The measurements are done every measure_obs_every_n_iter iterations. The target tempertures will fall on multiples of measure_obs_every_n_iter Default is 20.

k_bfloat, optional

Value for Boltzmann constant.

**kwargs : other TNConvergenceParameters parameters

Attributes

self.sim_params[‘imag_evo_dt’]np.ndarray

Time step grid.

self.measure_obs_every_n_iterint

See Parameters above.

self.n_gridnp.ndarray of int

The number of iterations/measure_obs_every_n_iter needed to reach each of the temperatures from t_grid, starting from the infinite temperature.

property temperature

Returns the grid of temperatures at which the measurements are made. To check if the grid corresponds to the input temperature grid, use self.temperature[self.n_grid].